* Change the directory to the top one for this project
set more off
capture cd "C:\Users\Benjamin Allen\Loewen-RubensonLab Dropbox\LR Research Lab - Shared\Papers\Support for Algorithmic Governance"
capture cd "C:\Users\balle\Loewen-RubensonLab Dropbox\LR Research Lab - Shared\Papers\Support for Algorithmic Governance"
capture cd "~\Loewen-RubensonLab Dropbox\LR Research Lab - Shared\Papers\Support for Algorithmic Governance"

use "data/EPIS_data recoded and labeled with scales.dta", clear


*-----------------------------------------------*
* Checking when each country's responses were fielded
*-----------------------------------------------*

sort startdate country_recoded enddate


********************************************************************************
* Models
********************************************************************************

*------------------------------------------------------------------------------*
* Summary of model variables
*------------------------------------------------------------------------------*

sum alg_govt_acceptable_scale_bi ///
	alg_govt_acc_eff_scale_bi ///
	alg_govt_acc_fair_scale_bi ///
	age_in_years_rescaled ///
	female ///
	subjective_income_rescaled ///
	education_cat_rescaled ///
	lr_scale_rescaled ///
	populism_scale

sum alg_govt_acceptable_scale_ord ///
	alg_govt_acc_eff_scale_ord ///
	alg_govt_acc_fair_scale_ord
	

*------------------------------------------------------------------------------*
* Run main model
*------------------------------------------------------------------------------*

*-----------------------------------------------*
* Pooled dataset
*-----------------------------------------------*

use "data/EPIS_data recoded and labeled with scales.dta", clear

* Binary version
regress alg_govt_acceptable_scale_bi ///
	age_in_years_rescaled ///
	female ///
	subjective_income_rescaled ///
	education_cat_rescaled ///
	lr_scale_rescaled ///
	populism_scale

estimates store alg_gov_ac_bi_EPIS

* Ordered version
regress alg_govt_acceptable_scale_ord ///
	age_in_years_rescaled ///
	female ///
	subjective_income_rescaled ///
	education_cat_rescaled ///
	lr_scale_rescaled ///
	populism_scale

estimates store alg_gov_ac_ord_EPIS

*-----------------------------------------------*
* For each country
*-----------------------------------------------*

foreach country_recoded in 	"Austria" "BelgiumFR" "BelgiumNL" "Denmark" "Finland" "France" "Germany" "Greece" "Ireland" "Italy" "Netherlands" "Norway" "Portugal" "Spain" "Sweden" "UK" {

	use "data/EPIS_data recoded and labeled with scales.dta", clear

	lab li country_recoded
	
	lab def country_recoded 2 "BelgiumFR" 3 "BelgiumNL", modify
	
	keep if country_recoded == "`country_recoded'":country_recoded

	di "`country_recoded'"
	
	* Binary version
	regress alg_govt_acceptable_scale_bi ///
		age_in_years_rescaled ///
		female ///
		subjective_income_rescaled ///
		education_cat_rescaled ///
		lr_scale_rescaled ///
		populism_scale

	estimates store alg_gov_ac_bi_`country_recoded'

	* Ordered version
	regress alg_govt_acceptable_scale_ord ///
		age_in_years_rescaled ///
		female ///
		subjective_income_rescaled ///
		education_cat_rescaled ///
		lr_scale_rescaled ///
		populism_scale

	estimates store alg_gov_ac_ord_`country_recoded'
	
	clear
}


*------------------------------------------------------------------------------*
* Models of sub-scales
*------------------------------------------------------------------------------*

*-----------------------------------------------*
* Pooled dataset
*-----------------------------------------------*

use "data/EPIS_data recoded and labeled with scales.dta", clear

* Just efficiency items

* Binary version
regress alg_govt_acc_eff_scale_bi ///
	age_in_years_rescaled ///
	female ///
	subjective_income_rescaled ///
	education_cat_rescaled ///
	lr_scale_rescaled ///
	populism_scale

estimates store acc_eff_bi_EPIS

*Ordered version
regress alg_govt_acc_eff_scale_ord ///
	age_in_years_rescaled ///
	female ///
	subjective_income_rescaled ///
	education_cat_rescaled ///
	lr_scale_rescaled ///
	populism_scale

estimates store acc_eff_ord_EPIS
	
* Just fairness items

* Binary version
regress alg_govt_acc_fair_scale_bi ///
	age_in_years_rescaled ///
	female ///
	subjective_income_rescaled ///
	education_cat_rescaled ///
	lr_scale_rescaled ///
	populism_scale
	
estimates store acc_fair_bi_EPIS

* Ordered version
regress alg_govt_acc_fair_scale_ord ///
	age_in_years_rescaled ///
	female ///
	subjective_income_rescaled ///
	education_cat_rescaled ///
	lr_scale_rescaled ///
	populism_scale
	
estimates store acc_fair_ord_EPIS

*-----------------------------------------------*
* For each country
*-----------------------------------------------*

foreach country_recoded in 	"Austria" "BelgiumFR" "BelgiumNL" "Denmark" "Finland" "France" "Germany" "Greece" "Ireland" "Italy" "Netherlands" "Norway" "Portugal" "Spain" "Sweden" "UK" {

	use "data/EPIS_data recoded and labeled with scales.dta", clear

	lab li country_recoded
	
	lab def country_recoded 2 "BelgiumFR" 3 "BelgiumNL", modify
	
	keep if country_recoded == "`country_recoded'":country_recoded

	di "`country_recoded'"
	
		
	* Just efficiency items

	* Binary version
	regress alg_govt_acc_eff_scale_bi ///
		age_in_years_rescaled ///
		female ///
		subjective_income_rescaled ///
		education_cat_rescaled ///
		lr_scale_rescaled ///
		populism_scale

	estimates store acc_eff_bi_`country_recoded'

	*Ordered version
	regress alg_govt_acc_eff_scale_ord ///
		age_in_years_rescaled ///
		female ///
		subjective_income_rescaled ///
		education_cat_rescaled ///
		lr_scale_rescaled ///
		populism_scale

	estimates store acc_eff_ord_`country_recoded'
		
	* Just fairness items

	* Binary version
	regress alg_govt_acc_fair_scale_bi ///
		age_in_years_rescaled ///
		female ///
		subjective_income_rescaled ///
		education_cat_rescaled ///
		lr_scale_rescaled ///
		populism_scale
		
	estimates store acc_fair_bi_`country_recoded'

	* Ordered version
	regress alg_govt_acc_fair_scale_ord ///
		age_in_years_rescaled ///
		female ///
		subjective_income_rescaled ///
		education_cat_rescaled ///
		lr_scale_rescaled ///
		populism_scale
		
	estimates store acc_fair_ord_`country_recoded'
	
	clear
	
}

********************************************************************************
* LaTeX tables
********************************************************************************

use "data/EPIS_data recoded and labeled with scales.dta", clear

*------------------------------------------------------------------------------*
* Pooled EPIS data
*------------------------------------------------------------------------------*

*---------------------------------------------------------------*
* Tables for use in presentations
*---------------------------------------------------------------*

esttab alg_gov_ac_bi_EPIS acc_eff_bi_EPIS acc_fair_bi_EPIS using "analysis\tables\EPIS/beamer\ols_alg_govt_acc_scale_bi_EPIS_comparing_scales.tex", replace ///
    b(3) se(3) /// values presented in the table
	nonumbers  noomitted ///
	nodepvars nobase ///
	label wrap ///
	/// eform /// this turns the coefficients into odds ratios
	title("OLS regressions of support for algorithmic governance, Pooled EPIS data") ///
	mtitles("Full DV scale" "Efficiency subscale" "Fairness subscale") ///
	/// LaTeX options to make the tables look better
	booktabs ///
	width(1.2\hsize) ///
	///page(dcolumn) /// Not needed if this is to be called by another tex file
	///alignment(D{.}{.}{-1}) /// This aligns the columns on the decimals, but Beamer doesn't like it
	/// Rescale the table so that it fits into a beamer frame
	/// Unfortunately this has to be after the caption for it to work properly, or I could just do this in the presentation file instead
	substitute( ///
	\begin{tabular*} \scalebox{0.65}{\begin{tabular*} ///
	\end{tabular*} \end{tabular*}} ///
	) ///
	///varlabels(,elist(weight:_cons "{break}{hline @width}"))  ///
	varwidth(22)


*---------------------------------------------------------------*
* Tables for use in articles
*---------------------------------------------------------------*

esttab alg_gov_ac_bi_EPIS acc_eff_bi_EPIS acc_fair_bi_EPIS using "analysis\tables\EPIS/article\ols_alg_govt_acc_scale_bi_EPIS_comparing_scales.tex", replace ///
    b(3) se(3) /// values presented in the table
	nonumbers  noomitted ///
	nodepvars nobase ///
	label wrap ///
	/// eform /// this turns the coefficients into odds ratios
	title("OLS regressions of support for algorithmic governance, Pooled EPIS data") ///
	mtitles("Full DV scale" "Efficiency subscale" "Fairness subscale") ///
	/// LaTeX options to make the tables look better
	booktabs ///
	width(1.2\hsize) ///
	///page(dcolumn) /// Not needed if this is to be called by another tex file
	alignment(D{.}{.}{-1}) /// This aligns the columns on the decimals, but Beamer doesn't like it
	///varlabels(,elist(weight:_cons "{break}{hline @width}"))  ///
	varwidth(22)

*---------------------------------------------------------------*
* Standalone tables
*---------------------------------------------------------------*

esttab alg_gov_ac_bi_EPIS acc_eff_bi_EPIS acc_fair_bi_EPIS using "analysis\tables\EPIS/standalone\ols_alg_govt_acc_scale_bi_EPIS_comparing_scales.tex", replace ///
    b(3) se(3) /// values presented in the table
	nonumbers  noomitted ///
	nodepvars nobase ///
	label wrap ///
	/// eform /// this turns the coefficients into odds ratios
	title("OLS regressions of support for algorithmic governance, Pooled EPIS data") ///
	mtitles("Full DV scale" "Efficiency subscale" "Fairness subscale") ///
	/// LaTeX options to make the tables look better
	booktabs ///
	width(1.2\hsize) ///
	page(dcolumn) /// Not needed if this is to be called by another tex file
	alignment(D{.}{.}{-1}) /// This aligns the columns on the decimals, but Beamer doesn't like it
	///varlabels(,elist(weight:_cons "{break}{hline @width}"))  ///
	varwidth(22)	

	
*------------------------------------------------------------------------------*
* EPIS countries
*------------------------------------------------------------------------------*


*---------------------------------------------------------------*
* Article tables
*---------------------------------------------------------------*

*-------------------------------------------------*
* Full scale
*-------------------------------------------------*

esttab ///
		alg_gov_ac_bi_Austria ///
		alg_gov_ac_bi_BelgiumFR ///
		alg_gov_ac_bi_BelgiumNL ///
		alg_gov_ac_bi_Denmark  ///
		alg_gov_ac_bi_Finland ///
		alg_gov_ac_bi_France ///
		alg_gov_ac_bi_Germany ///
		alg_gov_ac_bi_Greece ///
	using "analysis\tables\EPIS/article\ols_alg_govt_acc_scale_bi_EPIS_countries_A_G_full_scale.tex", replace ///
    b(3) se(3) /// values presented in the table
	nonumbers  noomitted ///
	nodepvars nobase ///
	label wrap ///
	/// eform /// this turns the coefficients into odds ratios
	title("OLS regressions of support for algorithmic governance, full scale: EPIS countries (A-G)") ///
	mtitles("Austria" "Belgium (FR)" "Belgium (NL)" "Denmark" "Finland" "France" "Germany" "Greece" ) ///
	/// LaTeX options to make the tables look better
	booktabs ///
	width(2.0\hsize) ///
	page(dcolumn) /// Not needed if this is to be called by another tex file
	alignment(D{.}{.}{-1}) /// This aligns the columns on the decimals, but Beamer doesn't like it

esttab ///
		alg_gov_ac_bi_Ireland ///
		alg_gov_ac_bi_Italy ///
		alg_gov_ac_bi_Netherlands ///
		alg_gov_ac_bi_Norway  ///
		alg_gov_ac_bi_Portugal ///
		alg_gov_ac_bi_Spain ///
		alg_gov_ac_bi_Sweden ///
		alg_gov_ac_bi_UK ///
	using "analysis\tables\EPIS/article\ols_alg_govt_acc_scale_bi_EPIS_countries_H_Z_full_scale.tex", replace ///
    b(3) se(3) /// values presented in the table
	nonumbers  noomitted ///
	nodepvars nobase ///
	label wrap ///
	/// eform /// this turns the coefficients into odds ratios
	title("OLS regressions of support for algorithmic governance, full scale: EPIS countries (H-Z)") ///
	mtitles("Ireland" "Italy" "Netherlands" "Norway" "Portugal" "Spain" "Sweden" "UK") ///
	/// LaTeX options to make the tables look better
	booktabs ///
	width(2.0\hsize) ///
	page(dcolumn) /// Not needed if this is to be called by another tex file
	alignment(D{.}{.}{-1}) /// This aligns the columns on the decimals, but Beamer doesn't like it


*-------------------------------------------------*
* Efficiency subscale
*-------------------------------------------------*

esttab ///
		acc_eff_bi_Austria ///
		acc_eff_bi_BelgiumFR ///
		acc_eff_bi_BelgiumNL ///
		acc_eff_bi_Denmark  ///
		acc_eff_bi_Finland ///
		acc_eff_bi_France ///
		acc_eff_bi_Germany ///
		acc_eff_bi_Greece ///
	using "analysis\tables\EPIS/article\ols_alg_govt_acc_scale_bi_EPIS_countries_A_G_efficiency_subscale.tex", replace ///
    b(3) se(3) /// values presented in the table
	nonumbers  noomitted ///
	nodepvars nobase ///
	label wrap ///
	/// eform /// this turns the coefficients into odds ratios
	title("OLS regressions of support for algorithmic governance, efficiency subscale: EPIS countries (A-G)") ///
	mtitles("Austria" "Belgium (FR)" "Belgium (NL)" "Denmark" "Finland" "France" "Germany" "Greece" ) ///
	/// LaTeX options to make the tables look better
	booktabs ///
	width(2.0\hsize) ///
	page(dcolumn) /// Not needed if this is to be called by another tex file
	alignment(D{.}{.}{-1}) /// This aligns the columns on the decimals, but Beamer doesn't like it

esttab ///
		acc_eff_bi_Ireland ///
		acc_eff_bi_Italy ///
		acc_eff_bi_Netherlands ///
		acc_eff_bi_Norway  ///
		acc_eff_bi_Portugal ///
		acc_eff_bi_Spain ///
		acc_eff_bi_Sweden ///
		acc_eff_bi_UK ///
	using "analysis\tables\EPIS/article\ols_alg_govt_acc_scale_bi_EPIS_countries_H_Z_efficiency_subscale.tex", replace ///
    b(3) se(3) /// values presented in the table
	nonumbers  noomitted ///
	nodepvars nobase ///
	label wrap ///
	/// eform /// this turns the coefficients into odds ratios
	title("OLS regressions of support for algorithmic governance, efficiency subscale: EPIS countries (H-Z)") ///
	mtitles("Ireland" "Italy" "Netherlands" "Norway" "Portugal" "Spain" "Sweden" "UK") ///
	/// LaTeX options to make the tables look better
	booktabs ///
	width(2.0\hsize) ///
	page(dcolumn) /// Not needed if this is to be called by another tex file
	alignment(D{.}{.}{-1}) /// This aligns the columns on the decimals, but Beamer doesn't like it
	


*-------------------------------------------------*
* Fairness subscale
*-------------------------------------------------*

esttab ///
		acc_fair_bi_Austria ///
		acc_fair_bi_BelgiumFR ///
		acc_fair_bi_BelgiumNL ///
		acc_fair_bi_Denmark  ///
		acc_fair_bi_Finland ///
		acc_fair_bi_France ///
		acc_fair_bi_Germany ///
		acc_fair_bi_Greece ///
	using "analysis\tables\EPIS/article\ols_alg_govt_acc_scale_bi_EPIS_countries_A_G_fairness_subscale.tex", replace ///
    b(3) se(3) /// values presented in the table
	nonumbers  noomitted ///
	nodepvars nobase ///
	label wrap ///
	/// eform /// this turns the coefficients into odds ratios
	title("OLS regressions of support for algorithmic governance, fairness subscale: EPIS countries (A-G)") ///
	mtitles("Austria" "Belgium (FR)" "Belgium (NL)" "Denmark" "Finland" "France" "Germany" "Greece" ) ///
	/// LaTeX options to make the tables look better
	booktabs ///
	width(2.0\hsize) ///
	page(dcolumn) /// Not needed if this is to be called by another tex file
	alignment(D{.}{.}{-1}) /// This aligns the columns on the decimals, but Beamer doesn't like it

esttab ///
		acc_fair_bi_Ireland ///
		acc_fair_bi_Italy ///
		acc_fair_bi_Netherlands ///
		acc_fair_bi_Norway  ///
		acc_fair_bi_Portugal ///
		acc_fair_bi_Spain ///
		acc_fair_bi_Sweden ///
		acc_fair_bi_UK ///
	using "analysis\tables\EPIS/article\ols_alg_govt_acc_scale_bi_EPIS_countries_H_Z_fairness_subscale.tex", replace ///
    b(3) se(3) /// values presented in the table
	nonumbers  noomitted ///
	nodepvars nobase ///
	label wrap ///
	/// eform /// this turns the coefficients into odds ratios
	title("OLS regressions of support for algorithmic governance, fairness subscale: EPIS countries (H-Z)") ///
	mtitles("Ireland" "Italy" "Netherlands" "Norway" "Portugal" "Spain" "Sweden" "UK") ///
	/// LaTeX options to make the tables look better
	booktabs ///
	width(2.0\hsize) ///
	page(dcolumn) /// Not needed if this is to be called by another tex file
	alignment(D{.}{.}{-1}) /// This aligns the columns on the decimals, but Beamer doesn't like it


*---------------------------------------------------------------*
* Presentation tables (Beamer)
*---------------------------------------------------------------*

*-------------------------------------------------*
* Full scale
*-------------------------------------------------*

esttab ///
		alg_gov_ac_bi_Austria ///
		alg_gov_ac_bi_BelgiumFR ///
		alg_gov_ac_bi_BelgiumNL ///
		alg_gov_ac_bi_Denmark  ///
		alg_gov_ac_bi_Finland ///
		alg_gov_ac_bi_France ///
		alg_gov_ac_bi_Germany ///
		alg_gov_ac_bi_Greece ///
	using "analysis\tables\EPIS/beamer\ols_alg_govt_acc_scale_bi_EPIS_countries_A_G_full_scale.tex", replace ///
    b(3) se(3) /// values presented in the table
	nonumbers  noomitted ///
	nodepvars nobase ///
	label wrap ///
	/// eform /// this turns the coefficients into odds ratios
	title("OLS regressions of support for algorithmic governance, full scale: EPIS countries (A-G)") ///
	mtitles("Austria" "Belgium (FR)" "Belgium (NL)" "Denmark" "Finland" "France" "Germany" "Greece" ) ///
	/// LaTeX options to make the tables look better
	booktabs ///
	width(2.0\hsize) ///
	///page(dcolumn) /// Not needed if this is to be called by another tex file
	///alignment(D{.}{.}{-1}) /// This aligns the columns on the decimals, but Beamer doesn't like it
	/// Rescale the table so that it fits into a beamer frame
	/// Unfortunately this has to be after the caption for it to work properly, or I could just do this in the presentation file instead
	substitute( ///
	\begin{tabular*} \scalebox{0.5}{\begin{tabular*} ///
	\end{tabular*} \end{tabular*}} ///
	)

esttab ///
		alg_gov_ac_bi_Ireland ///
		alg_gov_ac_bi_Italy ///
		alg_gov_ac_bi_Netherlands ///
		alg_gov_ac_bi_Norway  ///
		alg_gov_ac_bi_Portugal ///
		alg_gov_ac_bi_Spain ///
		alg_gov_ac_bi_Sweden ///
		alg_gov_ac_bi_UK ///
	using "analysis\tables\EPIS/beamer\ols_alg_govt_acc_scale_bi_EPIS_countries_H_Z_full_scale.tex", replace ///
    b(3) se(3) /// values presented in the table
	nonumbers  noomitted ///
	nodepvars nobase ///
	label wrap ///
	/// eform /// this turns the coefficients into odds ratios
	title("OLS regressions of support for algorithmic governance, full scale: EPIS countries (H-Z)") ///
	mtitles("Ireland" "Italy" "Netherlands" "Norway" "Portugal" "Spain" "Sweden" "UK") ///
	/// LaTeX options to make the tables look better
	booktabs ///
	width(2.0\hsize) ///
	///page(dcolumn) /// Not needed if this is to be called by another tex file
	///alignment(D{.}{.}{-1}) /// This aligns the columns on the decimals, but Beamer doesn't like it
	/// Rescale the table so that it fits into a beamer frame
	/// Unfortunately this has to be after the caption for it to work properly, or I could just do this in the presentation file instead
	substitute( ///
	\begin{tabular*} \scalebox{0.5}{\begin{tabular*} ///
	\end{tabular*} \end{tabular*}} ///
	)


*-------------------------------------------------*
* Efficiency subscale
*-------------------------------------------------*

esttab ///
		acc_eff_bi_Austria ///
		acc_eff_bi_BelgiumFR ///
		acc_eff_bi_BelgiumNL ///
		acc_eff_bi_Denmark  ///
		acc_eff_bi_Finland ///
		acc_eff_bi_France ///
		acc_eff_bi_Germany ///
		acc_eff_bi_Greece ///
	using "analysis\tables\EPIS/beamer\ols_alg_govt_acc_scale_bi_EPIS_countries_A_G_efficiency_subscale.tex", replace ///
    b(3) se(3) /// values presented in the table
	nonumbers  noomitted ///
	nodepvars nobase ///
	label wrap ///
	/// eform /// this turns the coefficients into odds ratios
	title("OLS regressions of support for algorithmic governance, efficiency subscale: EPIS countries (A-G)") ///
	mtitles("Austria" "Belgium (FR)" "Belgium (NL)" "Denmark" "Finland" "France" "Germany" "Greece" ) ///
	/// LaTeX options to make the tables look better
	booktabs ///
	width(2.0\hsize) ///
	///page(dcolumn) /// Not needed if this is to be called by another tex file
	///alignment(D{.}{.}{-1}) /// This aligns the columns on the decimals, but Beamer doesn't like it
	/// Rescale the table so that it fits into a beamer frame
	/// Unfortunately this has to be after the caption for it to work properly, or I could just do this in the presentation file instead
	substitute( ///
	\begin{tabular*} \scalebox{0.5}{\begin{tabular*} ///
	\end{tabular*} \end{tabular*}} ///
	)

esttab ///
		acc_eff_bi_Ireland ///
		acc_eff_bi_Italy ///
		acc_eff_bi_Netherlands ///
		acc_eff_bi_Norway  ///
		acc_eff_bi_Portugal ///
		acc_eff_bi_Spain ///
		acc_eff_bi_Sweden ///
		acc_eff_bi_UK ///
	using "analysis\tables\EPIS/beamer\ols_alg_govt_acc_scale_bi_EPIS_countries_H_Z_efficiency_subscale.tex", replace ///
    b(3) se(3) /// values presented in the table
	nonumbers  noomitted ///
	nodepvars nobase ///
	label wrap ///
	/// eform /// this turns the coefficients into odds ratios
	title("OLS regressions of support for algorithmic governance, efficiency subscale: EPIS countries (H-Z)") ///
	mtitles("Ireland" "Italy" "Netherlands" "Norway" "Portugal" "Spain" "Sweden" "UK") ///
	/// LaTeX options to make the tables look better
	booktabs ///
	width(2.0\hsize) ///
	///page(dcolumn) /// Not needed if this is to be called by another tex file
	///alignment(D{.}{.}{-1}) /// This aligns the columns on the decimals, but Beamer doesn't like it
	/// Rescale the table so that it fits into a beamer frame
	/// Unfortunately this has to be after the caption for it to work properly, or I could just do this in the presentation file instead
	substitute( ///
	\begin{tabular*} \scalebox{0.5}{\begin{tabular*} ///
	\end{tabular*} \end{tabular*}} ///
	)
	


*-------------------------------------------------*
* Fairness subscale
*-------------------------------------------------*

esttab ///
		acc_fair_bi_Austria ///
		acc_fair_bi_BelgiumFR ///
		acc_fair_bi_BelgiumNL ///
		acc_fair_bi_Denmark  ///
		acc_fair_bi_Finland ///
		acc_fair_bi_France ///
		acc_fair_bi_Germany ///
		acc_fair_bi_Greece ///
	using "analysis\tables\EPIS/beamer\ols_alg_govt_acc_scale_bi_EPIS_countries_A_G_fairness_subscale.tex", replace ///
    b(3) se(3) /// values presented in the table
	nonumbers  noomitted ///
	nodepvars nobase ///
	label wrap ///
	/// eform /// this turns the coefficients into odds ratios
	title("OLS regressions of support for algorithmic governance, fairness subscale: EPIS countries (A-G)") ///
	mtitles("Austria" "Belgium (FR)" "Belgium (NL)" "Denmark" "Finland" "France" "Germany" "Greece" ) ///
	/// LaTeX options to make the tables look better
	booktabs ///
	width(2.0\hsize) ///
	///page(dcolumn) /// Not needed if this is to be called by another tex file
	///alignment(D{.}{.}{-1}) /// This aligns the columns on the decimals, but Beamer doesn't like it
	/// Rescale the table so that it fits into a beamer frame
	/// Unfortunately this has to be after the caption for it to work properly, or I could just do this in the presentation file instead
	substitute( ///
	\begin{tabular*} \scalebox{0.5}{\begin{tabular*} ///
	\end{tabular*} \end{tabular*}} ///
	)

esttab ///
		acc_fair_bi_Ireland ///
		acc_fair_bi_Italy ///
		acc_fair_bi_Netherlands ///
		acc_fair_bi_Norway  ///
		acc_fair_bi_Portugal ///
		acc_fair_bi_Spain ///
		acc_fair_bi_Sweden ///
		acc_fair_bi_UK ///
	using "analysis\tables\EPIS/beamer\ols_alg_govt_acc_scale_bi_EPIS_countries_H_Z_fairness_subscale.tex", replace ///
    b(3) se(3) /// values presented in the table
	nonumbers  noomitted ///
	nodepvars nobase ///
	label wrap ///
	/// eform /// this turns the coefficients into odds ratios
	title("OLS regressions of support for algorithmic governance, fairness subscale: EPIS countries (H-Z)") ///
	mtitles("Ireland" "Italy" "Netherlands" "Norway" "Portugal" "Spain" "Sweden" "UK") ///
	/// LaTeX options to make the tables look better
	booktabs ///
	width(2.0\hsize) ///
	///page(dcolumn) /// Not needed if this is to be called by another tex file
	///alignment(D{.}{.}{-1}) /// This aligns the columns on the decimals, but Beamer doesn't like it
	/// Rescale the table so that it fits into a beamer frame
	/// Unfortunately this has to be after the caption for it to work properly, or I could just do this in the presentation file instead
	substitute( ///
	\begin{tabular*} \scalebox{0.5}{\begin{tabular*} ///
	\end{tabular*} \end{tabular*}} ///
	)
	
*---------------------------------------------------------------*
* Standalone tables
*---------------------------------------------------------------*

*-------------------------------------------------*
* Full scale
*-------------------------------------------------*

esttab ///
		alg_gov_ac_bi_Austria ///
		alg_gov_ac_bi_BelgiumFR ///
		alg_gov_ac_bi_BelgiumNL ///
		alg_gov_ac_bi_Denmark  ///
		alg_gov_ac_bi_Finland ///
		alg_gov_ac_bi_France ///
		alg_gov_ac_bi_Germany ///
		alg_gov_ac_bi_Greece ///
	using "analysis\tables\EPIS/standalone\ols_alg_govt_acc_scale_bi_EPIS_countries_A_G_full_scale.tex", replace ///
    b(3) se(3) /// values presented in the table
	nonumbers  noomitted ///
	nodepvars nobase ///
	label wrap ///
	/// eform /// this turns the coefficients into odds ratios
	title("OLS regressions of support for algorithmic governance, full scale: EPIS countries (A-G)") ///
	mtitles("Austria" "Belgium (FR)" "Belgium (NL)" "Denmark" "Finland" "France" "Germany" "Greece" ) ///
	/// LaTeX options to make the tables look better
	booktabs ///
	width(2.0\hsize) ///
	page(dcolumn, rotating) /// Not needed if this is to be called by another tex file
	alignment(D{.}{.}{-1}) /// This aligns the columns on the decimals, but Beamer doesn't like it
	/// Rescale the table so that it fits into a beamer frame
	/// Unfortunately this has to be after the caption for it to work properly, or I could just do this in the presentation file instead
	substitute( ///
	\begin{tabular*} \scalebox{0.6}{\begin{tabular*} ///
	\end{tabular*} \end{tabular*}} ///
	)

esttab ///
		alg_gov_ac_bi_Ireland ///
		alg_gov_ac_bi_Italy ///
		alg_gov_ac_bi_Netherlands ///
		alg_gov_ac_bi_Norway  ///
		alg_gov_ac_bi_Portugal ///
		alg_gov_ac_bi_Spain ///
		alg_gov_ac_bi_Sweden ///
		alg_gov_ac_bi_UK ///
	using "analysis\tables\EPIS/standalone\ols_alg_govt_acc_scale_bi_EPIS_countries_H_Z_full_scale.tex", replace ///
    b(3) se(3) /// values presented in the table
	nonumbers  noomitted ///
	nodepvars nobase ///
	label wrap ///
	/// eform /// this turns the coefficients into odds ratios
	title("OLS regressions of support for algorithmic governance, full scale: EPIS countries (H-Z)") ///
	mtitles("Ireland" "Italy" "Netherlands" "Norway" "Portugal" "Spain" "Sweden" "UK") ///
	/// LaTeX options to make the tables look better
	booktabs ///
	width(2.0\hsize) ///
	page(dcolumn, rotating) /// Not needed if this is to be called by another tex file
	alignment(D{.}{.}{-1}) /// This aligns the columns on the decimals, but Beamer doesn't like it
	/// Rescale the table so that it fits into a beamer frame
	/// Unfortunately this has to be after the caption for it to work properly, or I could just do this in the presentation file instead
	substitute( ///
	\begin{tabular*} \scalebox{0.6}{\begin{tabular*} ///
	\end{tabular*} \end{tabular*}} ///
	)	


*-------------------------------------------------*
* Efficiency subscale
*-------------------------------------------------*

esttab ///
		acc_eff_bi_Austria ///
		acc_eff_bi_BelgiumFR ///
		acc_eff_bi_BelgiumNL ///
		acc_eff_bi_Denmark  ///
		acc_eff_bi_Finland ///
		acc_eff_bi_France ///
		acc_eff_bi_Germany ///
		acc_eff_bi_Greece ///
	using "analysis\tables\EPIS/standalone\ols_alg_govt_acc_scale_bi_EPIS_countries_A_G_efficiency_subscale.tex", replace ///
    b(3) se(3) /// values presented in the table
	nonumbers  noomitted ///
	nodepvars nobase ///
	label wrap ///
	/// eform /// this turns the coefficients into odds ratios
	title("OLS regressions of support for algorithmic governance, efficiency subscale: EPIS countries (A-G)") ///
	mtitles("Austria" "Belgium (FR)" "Belgium (NL)" "Denmark" "Finland" "France" "Germany" "Greece" ) ///
	/// LaTeX options to make the tables look better
	booktabs ///
	width(2.0\hsize) ///
	page(dcolumn, rotating) /// Not needed if this is to be called by another tex file
	alignment(D{.}{.}{-1}) /// This aligns the columns on the decimals, but Beamer doesn't like it
	/// Rescale the table so that it fits into a beamer frame
	/// Unfortunately this has to be after the caption for it to work properly, or I could just do this in the presentation file instead
	substitute( ///
	\begin{tabular*} \scalebox{0.6}{\begin{tabular*} ///
	\end{tabular*} \end{tabular*}} ///
	)

esttab ///
		acc_eff_bi_Ireland ///
		acc_eff_bi_Italy ///
		acc_eff_bi_Netherlands ///
		acc_eff_bi_Norway  ///
		acc_eff_bi_Portugal ///
		acc_eff_bi_Spain ///
		acc_eff_bi_Sweden ///
		acc_eff_bi_UK ///
	using "analysis\tables\EPIS/standalone\ols_alg_govt_acc_scale_bi_EPIS_countries_H_Z_efficiency_subscale.tex", replace ///
    b(3) se(3) /// values presented in the table
	nonumbers  noomitted ///
	nodepvars nobase ///
	label wrap ///
	/// eform /// this turns the coefficients into odds ratios
	title("OLS regressions of support for algorithmic governance, efficiency subscale: EPIS countries (H-Z)") ///
	mtitles("Ireland" "Italy" "Netherlands" "Norway" "Portugal" "Spain" "Sweden" "UK") ///
	/// LaTeX options to make the tables look better
	booktabs ///
	width(2.0\hsize) ///
	page(dcolumn, rotating) /// Not needed if this is to be called by another tex file
	alignment(D{.}{.}{-1}) /// This aligns the columns on the decimals, but Beamer doesn't like it
	/// Rescale the table so that it fits into a beamer frame
	/// Unfortunately this has to be after the caption for it to work properly, or I could just do this in the presentation file instead
	substitute( ///
	\begin{tabular*} \scalebox{0.6}{\begin{tabular*} ///
	\end{tabular*} \end{tabular*}} ///
	)
	


*-------------------------------------------------*
* Fairness subscale
*-------------------------------------------------*

esttab ///
		acc_fair_bi_Austria ///
		acc_fair_bi_BelgiumFR ///
		acc_fair_bi_BelgiumNL ///
		acc_fair_bi_Denmark  ///
		acc_fair_bi_Finland ///
		acc_fair_bi_France ///
		acc_fair_bi_Germany ///
		acc_fair_bi_Greece ///
	using "analysis\tables\EPIS/standalone\ols_alg_govt_acc_scale_bi_EPIS_countries_A_G_fairness_subscale.tex", replace ///
    b(3) se(3) /// values presented in the table
	nonumbers  noomitted ///
	nodepvars nobase ///
	label wrap ///
	/// eform /// this turns the coefficients into odds ratios
	title("OLS regressions of support for algorithmic governance, fairness subscale: EPIS countries (A-G)") ///
	mtitles("Austria" "Belgium (FR)" "Belgium (NL)" "Denmark" "Finland" "France" "Germany" "Greece" ) ///
	/// LaTeX options to make the tables look better
	booktabs ///
	width(2.0\hsize) ///
	page(dcolumn, rotating) /// Not needed if this is to be called by another tex file
	alignment(D{.}{.}{-1}) /// This aligns the columns on the decimals, but Beamer doesn't like it
	/// Rescale the table so that it fits into a beamer frame
	/// Unfortunately this has to be after the caption for it to work properly, or I could just do this in the presentation file instead
	substitute( ///
	\begin{tabular*} \scalebox{0.6}{\begin{tabular*} ///
	\end{tabular*} \end{tabular*}} ///
	)

esttab ///
		acc_fair_bi_Ireland ///
		acc_fair_bi_Italy ///
		acc_fair_bi_Netherlands ///
		acc_fair_bi_Norway  ///
		acc_fair_bi_Portugal ///
		acc_fair_bi_Spain ///
		acc_fair_bi_Sweden ///
		acc_fair_bi_UK ///
	using "analysis\tables\EPIS/standalone\ols_alg_govt_acc_scale_bi_EPIS_countries_H_Z_fairness_subscale.tex", replace ///
    b(3) se(3) /// values presented in the table
	nonumbers  noomitted ///
	nodepvars nobase ///
	label wrap ///
	/// eform /// this turns the coefficients into odds ratios
	title("OLS regressions of support for algorithmic governance, fairness subscale: EPIS countries (H-Z)") ///
	mtitles("Ireland" "Italy" "Netherlands" "Norway" "Portugal" "Spain" "Sweden" "UK") ///
	/// LaTeX options to make the tables look better
	booktabs ///
	width(2.0\hsize) ///
	page(dcolumn, rotating) /// Not needed if this is to be called by another tex file
	alignment(D{.}{.}{-1}) /// This aligns the columns on the decimals, but Beamer doesn't like it
	/// Rescale the table so that it fits into a beamer frame
	/// Unfortunately this has to be after the caption for it to work properly, or I could just do this in the presentation file instead
	substitute( ///
	\begin{tabular*} \scalebox{0.6}{\begin{tabular*} ///
	\end{tabular*} \end{tabular*}} ///
	)		
	
	
********************************************************************************
* Coefficient plots
********************************************************************************

use "data/EPIS_data recoded and labeled with scales.dta", clear


* Just using the binary version of support for algorithmic governance, as they 

*------------------------------------------------------------------------------*
* Pooled EPIS data
*------------------------------------------------------------------------------*

*-----------------------------------------------*
* Comparing full scale and subscale
*-----------------------------------------------*

coefplot ///
	(alg_gov_ac_bi_EPIS,	label("Full scale") 			mcolor(edkblue)		msymbol(circle) 	msize(vsmall) ciopts(lcolor(edkblue) lwidth(thin))) ///
	(acc_eff_bi_EPIS, 		label("Efficiency subscale") 	mcolor(eltblue)		msymbol(circle) 	msize(vsmall) ciopts(lcolor(eltblue) lwidth(thin))) ///
	(acc_fair_bi_EPIS, 		label("Fairness subscale") 		mcolor(eltgreen)		msymbol(circle) 	msize(vsmall) ciopts(lcolor(eltgreen) lwidth(thin))) ///
	, drop(_cons) xline(0) ci(95) ///
	xlabels(-.4(.1).4, labsize(vsmall)) ///
	coeflabels( ///
		/* job_instructions_binary = "Follow instructions" */ ///
	, labsize(vsmall) wrap(22)) ///
	title("OLS regressions of support for algorithmic governance", size(medsmall)) ///
	subtitle("Pooled EPIS data, comparing full scale and subscales", size(small)) ///
	///subtitle("Binary DV", size(small)) ///
	legend(col(1) pos(6) size(small)) ///
	graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) bgcolor(white)
	
graph export "analysis/graphs/EPIS/coefplots/coefplot-ols_alg_govt_acc_scale_bi_EPIS_comparing_scales.png", width(3300) height(2500) replace
	
	
*------------------------------------------------------------------------------*
* EPIS data by country
*------------------------------------------------------------------------------*


*-----------------------------------------------*
* Full scale
*-----------------------------------------------*

coefplot ///
	(alg_gov_ac_bi_EPIS, 		label("Pooled EPIS data") 	mcolor(black)		msymbol(circle) 	msize(vsmall) ciopts(lcolor(black) lwidth(thin))) ///
	(alg_gov_ac_bi_Austria,		label("Austria") 			mcolor(red)			msymbol(triangle) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(alg_gov_ac_bi_BelgiumFR,	label("Belgium (FR)") 			mcolor(sand)		msymbol(square) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(alg_gov_ac_bi_BelgiumNL, 	label("Belgium (NL)") 			mcolor(sandb)		msymbol(diamond) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(alg_gov_ac_bi_Denmark, 	label("Denmark") 			mcolor(cranberry)	msymbol(triangle) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(alg_gov_ac_bi_Finland, 	label("Finland") 			mcolor(edkblue)		msymbol(square) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(alg_gov_ac_bi_France, 		label("France") 			mcolor(ebblue)		msymbol(diamond) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(alg_gov_ac_bi_Germany, 	label("Germany") 			mcolor(maroon)		msymbol(square) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(alg_gov_ac_bi_Greece, 		label("Greece") 			mcolor(eltblue)		msymbol(square) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(alg_gov_ac_bi_Ireland, 	label("Ireland") 			mcolor(dkorange)	msymbol(triangle) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(alg_gov_ac_bi_Italy, 		label("Italy") 				mcolor(midgreen)	msymbol(diamond) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(alg_gov_ac_bi_Netherlands,	label("Netherlands") 		mcolor(erose)		msymbol(square) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(alg_gov_ac_bi_Norway, 		label("Norway") 			mcolor(pink)		msymbol(diamond) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(alg_gov_ac_bi_Portugal, 	label("Portugal") 			mcolor(midgreen)	msymbol(triangle) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(alg_gov_ac_bi_Spain, 		label("Spain") 				mcolor(gold)		msymbol(square) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(alg_gov_ac_bi_Sweden, 		label("Sweden") 			mcolor(teal)		msymbol(diamond) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(alg_gov_ac_bi_UK, 			label("UK") 				mcolor(navy)		msymbol(triangle) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	, drop(_cons) xline(0) ci(95) ///
	xlabels(-.4(.1).4, labsize(vsmall)) ///
	coeflabels( ///
		/* job_instructions_binary = "Follow instructions" */ ///
	, labsize(vsmall) wrap(22)) ///
	title("OLS regressions of support for algorithmic governance", size(medsmall)) ///
	subtitle("Model 1: Full scale", size(medsmall)) ///
	///subtitle("Binary DV", size(small)) ///
	legend(col(1) pos(3) size(small)) ///
	graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) bgcolor(white)
	
graph export "analysis/graphs/EPIS/coefplots/coefplot-ols_alg_govt_acc_scale_bi_EPIS_full_scale.png", width(3300) height(2500) replace

*-----------------------------------------------*
* Efficiency subscale
*-----------------------------------------------*

coefplot ///
	(acc_eff_bi_EPIS, 			label("Pooled EPIS data") 	mcolor(black)		msymbol(circle) 	msize(vsmall) ciopts(lcolor(black) lwidth(thin))) ///
	(acc_eff_bi_Austria,		label("Austria") 			mcolor(red)			msymbol(triangle) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_eff_bi_BelgiumFR,		label("Belgium (FR)") 			mcolor(sand)		msymbol(square) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_eff_bi_BelgiumNL, 		label("Belgium (NL)") 			mcolor(sandb)		msymbol(diamond) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_eff_bi_Denmark, 		label("Denmark") 			mcolor(cranberry)	msymbol(triangle) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_eff_bi_Finland, 		label("Finland") 			mcolor(edkblue)		msymbol(square) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_eff_bi_France, 		label("France") 			mcolor(ebblue)		msymbol(diamond) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_eff_bi_Germany, 		label("Germany") 			mcolor(maroon)		msymbol(square) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_eff_bi_Greece, 		label("Greece") 			mcolor(eltblue)		msymbol(square) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_eff_bi_Ireland, 		label("Ireland") 			mcolor(dkorange)	msymbol(triangle) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_eff_bi_Italy, 			label("Italy") 				mcolor(midgreen)	msymbol(diamond) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_eff_bi_Netherlands,	label("Netherlands") 		mcolor(erose)		msymbol(square) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_eff_bi_Norway, 		label("Norway") 			mcolor(pink)		msymbol(diamond) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_eff_bi_Portugal, 		label("Portugal") 			mcolor(midgreen)	msymbol(triangle) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_eff_bi_Spain, 			label("Spain") 				mcolor(gold)		msymbol(square) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_eff_bi_Sweden, 		label("Sweden") 			mcolor(teal)		msymbol(diamond) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_eff_bi_UK, 			label("UK") 				mcolor(navy)		msymbol(triangle) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	, drop(_cons) xline(0) ci(95) ///
	xlabels(-.4(.1).4, labsize(vsmall)) ///
	coeflabels( ///
		/* job_instructions_binary = "Follow instructions" */ ///
	, labsize(vsmall) wrap(22)) ///
	title("OLS regressions of support for algorithmic governance", size(medsmall)) ///
	subtitle("Model 2: Efficiency subscale", size(medsmall)) ///
	///subtitle("Binary DV", size(small)) ///
	legend(col(1) pos(3) size(small)) ///
	graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) bgcolor(white)
	
graph export "analysis/graphs/EPIS/coefplots/coefplot-ols_alg_govt_acc_scale_bi_EPIS_eff_subscale.png", width(3300) height(2500) replace

*-----------------------------------------------*
* Fairness subscale
*-----------------------------------------------*

coefplot ///
	(acc_fair_bi_EPIS, 			label("Pooled EPIS data") 	mcolor(black)		msymbol(circle) 	msize(vsmall) ciopts(lcolor(black) lwidth(thin))) ///
	(acc_fair_bi_Austria,		label("Austria") 			mcolor(red)			msymbol(triangle) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_fair_bi_BelgiumFR,		label("Belgium (FR)") 			mcolor(sand)		msymbol(square) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_fair_bi_BelgiumNL, 	label("Belgium (NL)") 			mcolor(sandb)		msymbol(diamond) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_fair_bi_Denmark, 		label("Denmark") 			mcolor(cranberry)	msymbol(triangle) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_fair_bi_Finland, 		label("Finland") 			mcolor(edkblue)		msymbol(square) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_fair_bi_France, 		label("France") 			mcolor(ebblue)		msymbol(diamond) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_fair_bi_Germany, 		label("Germany") 			mcolor(maroon)		msymbol(square) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_fair_bi_Greece, 		label("Greece") 			mcolor(eltblue)		msymbol(square) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_fair_bi_Ireland, 		label("Ireland") 			mcolor(dkorange)	msymbol(triangle) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_fair_bi_Italy, 		label("Italy") 				mcolor(midgreen)	msymbol(diamond) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_fair_bi_Netherlands,	label("Netherlands") 		mcolor(erose)		msymbol(square) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_fair_bi_Norway, 		label("Norway") 			mcolor(pink)		msymbol(diamond) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_fair_bi_Portugal, 		label("Portugal") 			mcolor(midgreen)	msymbol(triangle) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_fair_bi_Spain, 		label("Spain") 				mcolor(gold)		msymbol(square) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_fair_bi_Sweden, 		label("Sweden") 			mcolor(teal)		msymbol(diamond) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_fair_bi_UK, 			label("UK") 				mcolor(navy)		msymbol(triangle) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	, drop(_cons) xline(0) ci(95) ///
	xlabels(-.4(.1).4, labsize(vsmall)) ///
	coeflabels( ///
		/* job_instructions_binary = "Follow instructions" */ ///
	, labsize(vsmall) wrap(22)) ///
	title("OLS regressions of support for algorithmic governance", size(medsmall)) ///
	subtitle("Model 3: Fairness subscale", size(medsmall)) ///
	///subtitle("Binary DV", size(small)) ///
	legend(col(1) pos(3) size(small)) ///
	graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) bgcolor(white)
	
graph export "analysis/graphs/EPIS/coefplots/coefplot-ols_alg_govt_acc_scale_bi_EPIS_fair_subscale.png", width(3300) height(2500) replace

*------------------------------------------------------------------------------*
* Ordered version of support for algorithmic governance
*------------------------------------------------------------------------------*


*-----------------------------------------------*
* Full scale
*-----------------------------------------------*

coefplot ///
	(alg_gov_ac_ord_EPIS, 			label("Pooled EPIS data") 	mcolor(black)		msymbol(circle) 	msize(vsmall) ciopts(lcolor(black) lwidth(thin))) ///
	(alg_gov_ac_ord_Austria,		label("Austria") 			mcolor(red)			msymbol(triangle) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(alg_gov_ac_ord_BelgiumFR,		label("Belgium (FR)") 			mcolor(sand)		msymbol(square) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(alg_gov_ac_ord_BelgiumNL, 		label("Belgium (NL)") 			mcolor(sandb)		msymbol(diamond) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(alg_gov_ac_ord_Denmark, 		label("Denmark") 			mcolor(cranberry)	msymbol(triangle) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(alg_gov_ac_ord_Finland, 		label("Finland") 			mcolor(edkblue)		msymbol(square) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(alg_gov_ac_ord_France, 		label("France") 			mcolor(ebblue)		msymbol(diamond) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(alg_gov_ac_ord_Germany, 		label("Germany") 			mcolor(maroon)		msymbol(square) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(alg_gov_ac_ord_Greece, 		label("Greece") 			mcolor(eltblue)		msymbol(square) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(alg_gov_ac_ord_Ireland, 		label("Ireland") 			mcolor(dkorange)	msymbol(triangle) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(alg_gov_ac_ord_Italy, 			label("Italy") 				mcolor(midgreen)	msymbol(diamond) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(alg_gov_ac_ord_Netherlands,	label("Netherlands") 		mcolor(erose)		msymbol(square) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(alg_gov_ac_ord_Norway, 		label("Norway") 			mcolor(pink)		msymbol(diamond) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(alg_gov_ac_ord_Portugal, 		label("Portugal") 			mcolor(midgreen)	msymbol(triangle) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(alg_gov_ac_ord_Spain, 			label("Spain") 				mcolor(gold)		msymbol(square) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(alg_gov_ac_ord_Sweden, 		label("Sweden") 			mcolor(teal)		msymbol(diamond) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(alg_gov_ac_ord_UK, 			label("UK") 				mcolor(navy)		msymbol(triangle) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	, drop(_cons) xline(0) ci(95) ///
	xlabels(-.4(.1).4, labsize(vsmall)) ///
	coeflabels( ///
		/* job_instructions_binary = "Follow instructions" */ ///
	, labsize(vsmall) wrap(22)) ///
	title("OLS regressions of support for algorithmic governance", size(medsmall)) ///
	subtitle("Model 1: Full scale", size(medsmall)) ///
	///subtitle("Binary DV", size(small)) ///
	legend(col(1) pos(3) size(small)) ///
	graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) bgcolor(white)
	
graph export "analysis/graphs/EPIS/coefplots/coefplot-ols_alg_govt_acc_scale_ord_EPIS_full_scale.png", width(3300) height(2500) replace

*-----------------------------------------------*
* Efficiency subscale
*-----------------------------------------------*

coefplot ///
	(acc_eff_ord_EPIS, 			label("Pooled EPIS data") 	mcolor(black)		msymbol(circle) 	msize(vsmall) ciopts(lcolor(black) lwidth(thin))) ///
	(acc_eff_ord_Austria,		label("Austria") 			mcolor(red)			msymbol(triangle) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_eff_ord_BelgiumFR,		label("Belgium (FR)") 			mcolor(sand)		msymbol(square) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_eff_ord_BelgiumNL, 	label("Belgium (NL)") 			mcolor(sandb)		msymbol(diamond) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_eff_ord_Denmark, 		label("Denmark") 			mcolor(cranberry)	msymbol(triangle) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_eff_ord_Finland, 		label("Finland") 			mcolor(edkblue)		msymbol(square) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_eff_ord_France, 		label("France") 			mcolor(ebblue)		msymbol(diamond) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_eff_ord_Germany, 		label("Germany") 			mcolor(maroon)		msymbol(square) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_eff_ord_Greece, 		label("Greece") 			mcolor(eltblue)		msymbol(square) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_eff_ord_Ireland, 		label("Ireland") 			mcolor(dkorange)	msymbol(triangle) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_eff_ord_Italy, 		label("Italy") 				mcolor(midgreen)	msymbol(diamond) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_eff_ord_Netherlands,	label("Netherlands") 		mcolor(erose)		msymbol(square) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_eff_ord_Norway, 		label("Norway") 			mcolor(pink)		msymbol(diamond) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_eff_ord_Portugal, 		label("Portugal") 			mcolor(midgreen)	msymbol(triangle) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_eff_ord_Spain, 		label("Spain") 				mcolor(gold)		msymbol(square) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_eff_ord_Sweden, 		label("Sweden") 			mcolor(teal)		msymbol(diamond) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_eff_ord_UK, 			label("UK") 				mcolor(navy)		msymbol(triangle) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	, drop(_cons) xline(0) ci(95) ///
	xlabels(-.4(.1).4, labsize(vsmall)) ///
	coeflabels( ///
		/* job_instructions_binary = "Follow instructions" */ ///
	, labsize(vsmall) wrap(22)) ///
	title("OLS regressions of support for algorithmic governance", size(medsmall)) ///
	subtitle("Model 2: Efficiency subscale", size(medsmall)) ///
	///subtitle("Binary DV", size(small)) ///
	legend(col(1) pos(3) size(small)) ///
	graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) bgcolor(white)
	
graph export "analysis/graphs/EPIS/coefplots/coefplot-ols_alg_govt_acc_scale_ord_EPIS_eff_subscale.png", width(3300) height(2500) replace

*-----------------------------------------------*
* Efficiency subscale
*-----------------------------------------------*

coefplot ///
	(acc_fair_ord_EPIS, 		label("Pooled EPIS data") 	mcolor(black)		msymbol(circle) 	msize(vsmall) ciopts(lcolor(black) lwidth(thin))) ///
	(acc_fair_ord_Austria,		label("Austria") 			mcolor(red)			msymbol(triangle) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_fair_ord_BelgiumFR,	label("Belgium (FR)") 			mcolor(sand)		msymbol(square) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_fair_ord_BelgiumNL, 	label("Belgium (NL)") 			mcolor(sandb)		msymbol(diamond) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_fair_ord_Denmark, 		label("Denmark") 			mcolor(cranberry)	msymbol(triangle) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_fair_ord_Finland, 		label("Finland") 			mcolor(edkblue)		msymbol(square) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_fair_ord_France, 		label("France") 			mcolor(ebblue)		msymbol(diamond) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_fair_ord_Germany, 		label("Germany") 			mcolor(maroon)		msymbol(square) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_fair_ord_Greece, 		label("Greece") 			mcolor(eltblue)		msymbol(square) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_fair_ord_Ireland, 		label("Ireland") 			mcolor(dkorange)	msymbol(triangle) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_fair_ord_Italy, 		label("Italy") 				mcolor(midgreen)	msymbol(diamond) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_fair_ord_Netherlands,	label("Netherlands") 		mcolor(erose)		msymbol(square) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_fair_ord_Norway, 		label("Norway") 			mcolor(pink)		msymbol(diamond) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_fair_ord_Portugal, 	label("Portugal") 			mcolor(midgreen)	msymbol(triangle) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_fair_ord_Spain, 		label("Spain") 				mcolor(gold)		msymbol(square) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_fair_ord_Sweden, 		label("Sweden") 			mcolor(teal)		msymbol(diamond) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	(acc_fair_ord_UK, 			label("UK") 				mcolor(navy)		msymbol(triangle) 	msize(vsmall) ciopts(lcolor(gs8) lwidth(thin))) ///
	, drop(_cons) xline(0) ci(95) ///
	xlabels(-.4(.1).4, labsize(vsmall)) ///
	coeflabels( ///
		/* job_instructions_binary = "Follow instructions" */ ///
	, labsize(vsmall) wrap(22)) ///
	title("OLS regressions of support for algorithmic governance", size(medsmall)) ///
	subtitle("Model 3: Fairness subscale", size(medsmall)) ///
	///subtitle("Binary DV", size(small)) ///
	legend(col(1) pos(3) size(small)) ///
	graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) bgcolor(white)
	
graph export "analysis/graphs/EPIS/coefplots/coefplot-ols_alg_govt_acc_scale_ord_EPIS_fair_subscale.png", width(3300) height(2500) replace

